home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 January: Mac OS SDK / Dev.CD Jan 00 SDK1.toast / Development Kits / Mac OS / QuickTime / QuickTime 3 Interfaces & Libs / QTDevMac / RIncludes / Sound.r < prev   
Encoding:
Text File  |  1998-08-21  |  9.8 KB  |  243 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        Sound.r
  3.  
  4.      Contains:    Sound Manager Interfaces.
  5.  
  6.      Version:    Technology:    Sound Manager 3.3
  7.                  Release:    QuickTime 3.0
  8.  
  9.      Copyright:    © 1986-1998 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. */
  18.  
  19. #ifndef __SOUND_R__
  20. #define __SOUND_R__
  21.  
  22. #ifndef __CONDITIONALMACROS_R__
  23. #include "ConditionalMacros.r"
  24. #endif
  25.  
  26. #define kInvalidSource                     0xFFFFFFFF            /* this source may be returned from GetInfo if no other source is the monitored source */
  27. #define kNoSource                         'none'                /* no source selection */
  28. #define kCDSource                         'cd  '                /* internal CD player input */
  29. #define kExtMicSource                     'emic'                /* external mic input */
  30. #define kRCAInSource                     'irca'                /* RCA jack input */
  31. #define kTVFMTunerSource                 'tvfm'
  32. #define kDAVInSource                     'idav'                /* DAV analog input */
  33. #define kIntMicSource                     'imic'                /* internal mic input */
  34. #define kMediaBaySource                 'mbay'                /* media bay input */
  35. #define kModemSource                     'modm'                /* modem input (internal modem on desktops, PCI input on PowerBooks) */
  36. #define kPCCardSource                     'pcm '                /* PC Card pwm input */
  37. #define kZoomVideoSource                 'zvpc'                /* zoom video input */
  38. #define kDVDSource                         'dvda'                /* DVD audio input */
  39.  
  40. #define kNoSoundComponentType             '****'
  41. #define kSoundComponentType             'sift'                /* component type */
  42. #define kSoundComponentPPCType             'nift'                /* component type for PowerPC code */
  43. #define kRate8SubType                     'ratb'                /* 8-bit rate converter */
  44. #define kRate16SubType                     'ratw'                /* 16-bit rate converter */
  45. #define kConverterSubType                 'conv'                /* sample format converter */
  46. #define kSndSourceSubType                 'sour'                /* generic source component */
  47. #define kMixerType                         'mixr'
  48. #define kMixer8SubType                     'mixb'                /* 8-bit mixer */
  49. #define kMixer16SubType                 'mixw'                /* 16-bit mixer */
  50. #define kSoundInputDeviceType             'sinp'                /* sound input component */
  51. #define kWaveInSubType                     'wavi'                /* Windows Wave */
  52. #define kSoundOutputDeviceType             'sdev'                /* sound output component */
  53. #define kClassicSubType                 'clas'                /* classic hardware, i.e. Mac Plus */
  54. #define kASCSubType                     'asc '                /* Apple Sound Chip device */
  55. #define kDSPSubType                     'dsp '                /* DSP device */
  56. #define kAwacsSubType                     'awac'                /* Another of Will's Audio Chips device */
  57. #define kGCAwacsSubType                 'awgc'                /* Awacs audio with Grand Central DMA */
  58. #define kSingerSubType                     'sing'                /* Singer (via Whitney) based sound */
  59. #define kSinger2SubType                 'sng2'                /* Singer 2 (via Whitney) for Acme */
  60. #define kWhitSubType                     'whit'                /* Whit sound component for PrimeTime 3 */
  61. #define kSoundBlasterSubType             'sbls'                /* Sound Blaster for CHRP */
  62. #define kWaveOutSubType                 'wavo'                /* Windows Wave */
  63. #define kDirectSoundSubType             'dsnd'                /* Direct Sound */
  64. #define kUNIXsdevSubType                 'un1x'                /* UNIX base sdev */
  65. #define kSoundCompressor                 'scom'
  66. #define kSoundDecompressor                 'sdec'
  67. #define kAudioComponentType             'adio'                /* Audio components and sub-types */
  68. #define kAwacsPhoneSubType                 'hphn'
  69. #define kAudioVisionSpeakerSubType         'telc'
  70. #define kAudioVisionHeadphoneSubType     'telh'
  71. #define kPhilipsFaderSubType             'tvav'
  72. #define kSGSToneSubType                 'sgs0'
  73. #define kSoundEffectsType                 'snfx'                /* sound effects type */
  74. #define kSSpLocalizationSubType         'snd3'
  75. #define kSoundPortHandlerType             'soph'                /* sound output port handler component */
  76. #define kAwacsGCSubType                 'awgc'                /* awacs GC port handler */
  77. #define kSoundOutPortType                 'sopt'                /* sound output port component */
  78. #define kIntSpkrSubType                 'ispk'                /* internal speaker */
  79. #define kHeadphonesSubType                 'hdpn'                /* headphones */
  80. #define kExtSpkrSubType                 'espk'                /* external speaker */
  81. #define kEffectSubType                     'efct'                /* effect (like SRS or some other DSP function) */
  82. #define kSubwooferSubType                 'subw'                /* subwoofer */
  83. #define kSoundPowerType                 'spwr'                /* sound power component */
  84. #define kPowerAwacsSubType                 'awac'                /* awacs power */
  85. #define kPowerScreamerSubType             'scrm'                /* screamer power */
  86.  
  87. #define kSoundNotCompressed             'NONE'                /* sound is not compressed */
  88. #define k8BitOffsetBinaryFormat         'raw '                /* 8-bit offset binary */
  89. #define k16BitBigEndianFormat             'twos'                /* 16-bit big endian */
  90. #define k16BitLittleEndianFormat         'sowt'                /* 16-bit little endian */
  91. #define kFloat32Format                     'fl32'                /* 32-bit floating point */
  92. #define kFloat64Format                     'fl64'                /* 64-bit floating point */
  93. #define k24BitFormat                     'in24'                /* 24-bit integer */
  94. #define k32BitFormat                     'in32'                /* 32-bit integer */
  95. #define kMACE3Compression                 'MAC3'                /* MACE 3:1 */
  96. #define kMACE6Compression                 'MAC6'                /* MACE 6:1 */
  97. #define kCDXA4Compression                 'cdx4'                /* CD/XA 4:1 */
  98. #define kCDXA2Compression                 'cdx2'                /* CD/XA 2:1 */
  99. #define kIMACompression                 'ima4'                /* IMA 4:1 */
  100. #define kULawCompression                 'ulaw'                /* µLaw 2:1 */
  101. #define kALawCompression                 'alaw'                /* aLaw 2:1 */
  102. #define kMicrosoftADPCMFormat             0x6D730002            /* Microsoft ADPCM - ACM code 2 */
  103. #define kDVIIntelIMAFormat                 0x6D730011            /* DVI/Intel IMA ADPCM - ACM code 17 */
  104. #define kDVAudioFormat                     'dvca'                /* DV Audio */
  105. #define kQDesignCompression             'QDMC'                /* QDesign music */
  106. #define kQUALCOMMCompression             'Qclp'                /* QUALCOMM PureVoice */
  107. #define kOffsetBinary                     'raw '                /* for compatibility */
  108. #define kTwosComplement                 'twos'                /* for compatibility */
  109. #define kLittleEndianFormat             'sowt'                /* for compatibility */
  110.  
  111. #define k8BitRawIn                         0x01                /* data description */
  112. #define k8BitTwosIn                     0x02
  113. #define k16BitIn                         0x04
  114. #define kStereoIn                         0x08
  115. #define k8BitRawOut                     0x0100
  116. #define k8BitTwosOut                     0x0200
  117. #define k16BitOut                         0x0400
  118. #define kStereoOut                         0x0800
  119. #define kReverse                         0x00010000            /*   function description */
  120. #define kRateConvert                     0x00020000
  121. #define kCreateSoundSource                 0x00040000
  122. #define kHighQuality                     0x00400000            /*   performance description */
  123. #define kNonRealTime                     0x00800000
  124.  
  125.  
  126. /*----------------------------snd  • Sound----------------------------------------------*/
  127. type 'snd ' {
  128.         switch {
  129.             case FormatOne:
  130.                 key unsigned integer = $0001;
  131.                 unsigned integer = $$CountOf(Synthesizers);
  132.                 wide array Synthesizers {
  133.                     /* Resource ID of synthesizer/modifer */
  134.                     integer        squareWaveSynth        = $0001,
  135.                                 waveTableSynth        = $0003,
  136.                                 sampledSynth        = $0005;
  137.                     longint;                                    /* init parameter        */
  138.                 };
  139.  
  140.             case FormatTwo:
  141.                 key unsigned integer = $0002;
  142.                 integer        free = 0, keepInMemory = 256+1;        /* Space for refe count    */
  143.         };
  144.         unsigned integer = $$CountOf(SoundCmnds);
  145.         wide array SoundCmnds {
  146.             boolean        noData, hasData;
  147.             switch {
  148.                 case nullCmd:
  149.                     key bitstring[15] = 0;
  150.                     fill word;                                    /* Param 1 = nil        */
  151.                     fill long;                                    /* Param 2 = nil        */
  152.                 case quietCmd:
  153.                     key bitstring[15] = 3;
  154.                     fill word;                                    /* Param 1 = nil        */
  155.                     fill long;                                    /* Param 2 = nil        */
  156.                 case flushCmd:
  157.                     key bitstring[15] = 4;
  158.                     fill word;                                    /* Param 1 = nil        */
  159.                     fill long;                                    /* Param 2 = nil        */
  160.                 case waitCmd:
  161.                     key bitstring[15] = 10;
  162.                     integer        oneSecond = 2000;                /* Duration                */
  163.                     fill long;                                    /* Param 2 = nil        */
  164.                 case pauseCmd:
  165.                     key bitstring[15] = 11;
  166.                     fill word;                                    /* Param 1 = nil        */
  167.                     fill long;                                    /* Param 2 = nil        */
  168.                 case resumeCmd:
  169.                     key bitstring[15] = 12;
  170.                     fill word;                                    /* Param 1 = nil        */
  171.                     fill long;                                    /* Param 2 = nil        */
  172.                 case callBackCmd:
  173.                     key bitstring[15] = 13;
  174.                     integer;                                    /* User-defined            */
  175.                     longint;                                    /* User-defined            */
  176.                 case syncCmd:
  177.                     key bitstring[15] = 14;
  178.                     integer;                                    /* Count                */
  179.                     longint;                                    /* Identifier            */
  180.                 case emptyCmd:
  181.                     key bitstring[15] = 15;
  182.                     fill word;                                    /* Param 1 = nil        */
  183.                     fill long;                                    /* Param 2 = nil        */
  184.                 case freqDurationCmd:
  185.                     key bitstring[15] = 40;
  186.                     integer        oneSecond = 2000;                /* Duration                */
  187.                     longint;                                    /* frequency            */
  188.                 case restCmd:
  189.                     key bitstring[15] = 41;
  190.                     integer        oneSecond = 2000;                /* Duration                */
  191.                     fill long;                                    /* Param 2 = nil        */
  192.                 case freqCmd:
  193.                     key bitstring[15] = 42;
  194.                     fill word;                                    /* Param 1 = nil        */
  195.                     longint;                                    /* Frequency            */
  196.                 case ampCmd:
  197.                     key bitstring[15] = 43;
  198.                     integer;                                    /* Amplitude            */
  199.                     fill long;                                    /* Param 2                */
  200.                 case timbreCmd:
  201.                     key bitstring[15] = 44;
  202.                     integer        sineWave, squareWave = 255;        /* Timbre                */
  203.                     fill long;                                    /* Param 2                */
  204.                 case waveTableCmd:
  205.                     key bitstring[15] = 60;
  206.                     unsigned integer;                            /* Length                */
  207.                     longint;                                    /* Pointer to table        */
  208.                 case phaseCmd:
  209.                     key bitstring[15] = 61;
  210.                     integer;                                    /* Shift                */
  211.                     longint;                                    /* chanPtr                */
  212.                 case soundCmd:
  213.                     key bitstring[15] = 80;
  214.                     fill word;                                    /* Param 1 = nil        */
  215.                     longint;                                    /* Pointer to sound        */
  216.                 case bufferCmd:
  217.                     key bitstring[15] = 81;
  218.                     fill word;                                    /* Param 1 = nil        */
  219.                     longint;                                    /* Pointer to buffer    */
  220.                 case rateCmd:
  221.                     key bitstring[15] = 82;
  222.                     fill word;                                    /* Param 1 = nil        */
  223.                     longint;                                    /* Rate                    */
  224.             };
  225.         };
  226.         array DataTables {
  227.     DataTable:
  228.             fill long;                                            /* Pointer to data        */
  229.     SampleCnt:
  230.             unsigned longint;                                    /* # of sound samples    */
  231.             unsigned hex longint
  232.                     Rate22K = $56EE8BA3;                        /* Sampling rate        */
  233.             unsigned longint;                                    /* Start of loop        */
  234.             unsigned longint;                                    /* End of loop            */
  235.             hex byte;                                            /* encode (header type)    */
  236.             hex byte;                                            /* baseFrequency        */
  237.             hex string [$$Long(SampleCnt[$$ArrayIndex(DataTables)])];
  238.         };
  239. };
  240.  
  241. #endif /* __SOUND_R__ */
  242.  
  243.